#pragma once
#include <memory>
#include <string>
#include <sys/socket.h>
#include <unistd.h>

class TcpConnection : public std::enable_shared_from_this<TcpConnection>
{
public:
    TcpConnection(int fd);
    ~TcpConnection();

    void send(const std::string &message);
    std::string receive();
    void close();
    int getFd() const { return _fd; }

private:
    int _fd;
};